﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>订单详情</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link href="/admin/css/demo.css" rel="stylesheet" type="text/css" />

    <script src="/admin/js/boot.js" type="text/javascript"></script>
    <style type="text/css">
        .tt tr th,td{
            border: 1px solid lightblue;
            text-align: center;
            width: 20px;
        }
    </style>
</head>
<body>
<div style="width:100%;">
    <div class="mini-toolbar" style="border-bottom:0;padding:0px;">
        <table style="width:100%; text-align: center;" class="tt">

            <tr>
                <th>ID</th>
                <th>订单ID</th>
                <th>产品ID</th>
                <th>产品名称</th>
                <th>产品图片</th>
                <th>产品价格</th>
                <th>产品数量</th>
            </tr>
            <c:forEach items="${list}" var="add">
            <tr>
                <td>${add.get("id")}</td>
                <td>${add.get("order_id")}</td>
                <td>${add.get("gid")}</td>
                <td>${add.get("name")}</td>
                <td><img src="/upload/goods/logo/${add.get("logo")}" style="width: 100px;height: 100px"></td>

                <td>${add.get("price")}</td>
                <td>${add.get("num")}</td>
            </tr>
            </c:forEach>

        </table>
        <div style="text-align:center;padding:10px;">
            <input type="button" onclick="history.go(-1)" style="width:60px;margin-right:20px;" value="返回"/>
        </div>
    </div>
</div>




    <script type="text/javascript">
        mini.parse();

        var grid = mini.get("datagrid1");
        grid.load();
        grid.sortBy("createtime", "desc");

        function add() {
            mini.open({
                url: "/admin/page/order/order_edit.html",
                title: "添加新分类", width: 600, height: 400,
                onload: function () {
                    var iframe = this.getIFrameEl();
                    var data = { action: "new"};
                    iframe.contentWindow.SetData(data);
                },
                ondestroy: function (action) {

                    grid.reload();
                }
            });
        }

        function edit() {
         
            var row = grid.getSelected();
            if (row) {
                mini.open({

                    url:"/admin/page/order/orderDetail_edit.jsp",
                    title: "编辑订单", width: 600, height: 400,
                    onload: function () {
                        //alert("nfdsfdf")
                        //alert(row.id)

                        var iframe = this.getIFrameEl();
                        var data = { action: "edit", id: row.id};
                        iframe.contentWindow.SetData(data);
                    },
                    ondestroy: function (action) {
                        grid.reload();
                    }
                });
            } else {
                alert("请选中一条记录");
            }
            
        }
        //标准方法接口定义
        function SetData(data) {
            if (data.action == "edit") {
                //跨页面传递的数据对象，克隆后才可以安全使用
                data = mini.clone(data);
                 alert(data.id)
                // alert(data.idd)
                $.ajax({
                    url: "/fz_detail_query.do?id=" + data.id,
                    cache: false,
                    success: function (text) {
                        var o = mini.decode(text);
                        form.setData(o);
                        form.setChanged(false);

                        onDeptChanged();
                        mini.getbyName("position").setValue(o.position);
                    }
                });
            }
        }

        function remove() {

            var rows = grid.getSelecteds();
            if (rows.length > 0) {
                if (confirm("确定删除选中记录？")) {
                    var ids = [];
                    for (var i = 0, l = rows.length; i < l; i++) {
                        var r = rows[i];
                        ids.push(r.id);
                    }
                    var id = ids.join(',');

                    grid.loading("操作中，请稍后......");
                    $.ajax({
                        url: "/ad_order_delete.do?id="+id,
                        success: function (text) {
                            grid.reload();
                        },
                        error: function () {
                        }
                    });
                }
            } else {
                alert("请选中一条记录");
            }
        }

        function search() {
            var key = mini.get("key").getValue();
            grid.load({ key: key });
        }
        function onKeyEnter(e) {
            search();
        }
        /////////////////////////////////////////////////
        function onBirthdayRenderer(e) {
            var value = e.value;
            if (value) return mini.formatDate(value, 'yyyy-MM-dd');
            return "";
        }
        function onMarriedRenderer(e) {
            if (e.value == 1) return "是";
            else return "否";
        }
        var Genders = [{ id: 1, text: '男' }, { id: 2, text: '女'}];        
        function onGenderRenderer(e) {
            for (var i = 0, l = Genders.length; i < l; i++) {
                var g = Genders[i];
                if (g.id == e.value) return g.text;
            }
            return "";
        }

    </script>
</body>
</html>